package net.sky.oa.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 投票表
 * TalVote. @author hond
 */
@Entity
@Table(name = "TAL_VOTE")//投票表
public class TalVote implements java.io.Serializable {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields

	protected Long id;
	private String title;      //投票标题
	private Date createtime;   //发布时间
	private Date begintime;    //生效时间
	private Date endtime;      //终止时间
	private String annexurl;   //附件地址
	private Integer ismultiple;//是否多选：1是2否
	private Integer isshow;    //是否匿名：1是2否
	private Integer outcome;    //查看结果：1后2前3否
	private String desn;       //描述
	private Integer peoplecount;//查阅人数
	private Integer count;      //参与人数
	private Integer status;       //状态
	private SysEmployee user;  //所属人id

	// Constructors

	/** default constructor */
	public TalVote() {
	}
	
	@Id
    @Column(name = "ID", unique = true, nullable = false)
	@SequenceGenerator(name="SQ_TALVOTE_ID",sequenceName="SQ_TALVOTE_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_TALVOTE_ID")
	public Long getId() {
        return id;
    }

    public void setId(Long id){
    	this.id = id;
    }
    
	/** minimal constructor */
	public TalVote(Long id) {
		this.id = id;
	}

	@Column(name = "TITLE", length = 60)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "CREATETIME", length = 7)
	public Date getCreatetime() {
		return this.createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "BEGINTIME", length = 7)
	public Date getBegintime() {
		return this.begintime;
	}

	public void setBegintime(Date begintime) {
		this.begintime = begintime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "ENDTIME", length = 7)
	public Date getEndtime() {
		return this.endtime;
	}

	public void setEndtime(Date endtime) {
		this.endtime = endtime;
	}

	@Column(name = "ANNEXURL", length = 100)
	public String getAnnexurl() {
		return this.annexurl;
	}

	public void setAnnexurl(String annexurl) {
		this.annexurl = annexurl;
	}

	@Column(name = "ISMULTIPLE", precision = 1, scale = 0)
	public Integer getIsmultiple() {
		return this.ismultiple;
	}

	public void setIsmultiple(Integer ismultiple) {
		this.ismultiple = ismultiple;
	}

	@Column(name = "ISSHOW", precision = 1, scale = 0)
	public Integer getIsshow() {
		return this.isshow;
	}

	public void setIsshow(Integer isshow) {
		this.isshow = isshow;
	}
	
	@Column(name = "OUTCOME", precision = 1, scale = 0)
	public Integer getOutcome() {
		return this.outcome;
	}
	
	public void setOutcome(Integer outcome) {
		this.outcome = outcome;
	}

	@Column(name = "DESN", length = 100)
	public String getDesn() {
		return this.desn;
	}

	public void setDesn(String desn) {
		this.desn = desn;
	}
	
	@Column(name = "PEOPLECOUNT", precision = 5, scale = 0)
	public Integer getPeoplecount() {
		return this.peoplecount;
	}

	public void setPeoplecount(Integer peoplecount) {
		this.peoplecount = peoplecount;
	}
	
	@Column(name = "COUNT", precision = 5, scale = 0)
	public Integer getCount() {
		return this.count;
	}
	
	public void setCount(Integer count) {
		this.count = count;
	}

	@Column(name = "STATUS", precision = 2, scale = 0)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "USER_ID")
	public SysEmployee getUser() {
		return this.user;
	}

	public void setUser(SysEmployee user) {
		this.user = user;
	}
	
}